<!doctype html>
<html>
<head>
	<meta charset="utf-8"><meta name="format-detection" content="telephone=no">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
	<title>机构</title>
	<link rel="stylesheet" type="text/css" href="../../lib/css/skin.css"/>
</head>
<body>
<div id="root">
	<div class="app_warp">
		<div class="app_head">
			<span class="left back"></span>
			<span class="name">课程详情</span>
		</div>
		<div id="mechanism_view" class="app_main">
			<div class="nocontent animated fadeInUp">
				<img src="../../lib/img/loading.gif" class="minimize" alt="">
				<div class="text minimize">
					准备数据
				</div>
			</div>
		</div>
		<a id="pay_btn" href="javascript:;" style="display: none;" class="skin_btn" tapmode onclick="payThisOrder()">课程报名</a>
	</div>
</div>

<script id="mechanism_view_template" type="text/html">
	<div class="animated fadeInUp">
		<div class="topbg mechanism">
			<img class="imgcache" src="<%:=img%>" data_src="<%:=data.mechanism.avatar%>" alt="">
			<span class="name"><%:=data.name%></span>
			<span class="intro">
				<%:getAreaName=data.mechanism.s_province%> /
				<% for(var i in data.mechanism.curriculum){ %>
					<%:getClassifyName=data.mechanism.curriculum[i]%>
				<% } %>
			</span>
		</div>
		<div class="space"></div>
		<div class="app_box">
			<div class="box_tit">
			<span class="name">
				课程内容
			</span>
			</div>
			<div class="box_cont content_box">
				<%:=data.content%>
			</div>
		</div>
		<div class="app_box">
			<div class="box_tit">
			<span class="name">
				课次
			</span>
			</div>
			<div class="box_cont content_box">
				<%:=data.frequency%>
			</div>
		</div>
		<div class="app_box">
			<div class="box_tit">
			<span class="name">
				课程要求
			</span>
			</div>
			<div class="box_cont content_box">
				<%:=data.requirement%>
			</div>
		</div>
		<div class="app_box">
			<div class="box_tit">
			<span class="name">
				地点
			</span>
			</div>
			<div class="box_cont content_box">
				<%:=data.dd%>
			</div>
		</div>
		<div class="app_box">
			<div class="box_tit">
			<span class="name">
				课程费用
			</span>
			</div>
			<div class="box_cont content_box">
				<%:=data.cost%> / 课程

				<%
				cost = data.cost;
				%>
			</div>
		</div>

	</div>
</script>

<script>
	var
		payThisOrder = function () {
			api.openWin({
				name: 'mechanism_order_view',
				url: './mechanism_order_view.html',
				pageParam: {
					id: api.pageParam.id
				}
			})
		},
		appready = function () {
			_$.ajax({
				interface: 'getTcourse',
				data: {
					id: api.pageParam.id
				},
				call: function (data) {
					_$.db.get({
						key: 'area',
						call: function (area) {
							window.__areaData__ = area;
						}
					})
					_$.db.get({
						key: 'classify',
						call: function (classify) {
							window.__classifyData__ = classify;
						}
					})
					_$.template('mechanism_view_template', {
						data: data.data,
						img: _$.imgCache.default
					}, function (html) {
						_$.sleep(function () {
							$('#mechanism_view').html(html);
							_$.imgCache.load();
							_$.db.get({
								call:function(data){
									if(data.type===1){
										_$.sleep(function () {
											$('#pay_btn').fadeIn();
										}, 500);
									}
								}
							})
						}, 1000)
					})
				}
			})
		};
</script>
<script src="../../lib/js/config.js"></script>
<script src="../../lib/js/jquery.js"></script>
<script src="../../lib/js/common.js"></script>
<script>

</script>
</body>
</html>